home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Filezilla Server / FileZilla_Server-0_9_41.exe / source / interface / misc / SAPrefsDialog.h < prev    next >
C/C++ Source or Header  |  2011-11-06  |  4KB  |  141 lines

  1. /*********************************************************************
  2.  
  3.     Copyright (C) 2000 Smaller Animals Software, Inc.
  4.  
  5.     This software is provided 'as-is', without any express or implied
  6.     warranty.  In no event will the authors be held liable for any damages
  7.     arising from the use of this software.
  8.  
  9.     Permission is granted to anyone to use this software for any purpose,
  10.     including commercial applications, and to alter it and redistribute it
  11.     freely, subject to the following restrictions:
  12.  
  13.     1. The origin of this software must not be misrepresented; you must not
  14.       claim that you wrote the original software. If you use this software
  15.       in a product, an acknowledgment in the product documentation would be
  16.       appreciated but is not required.
  17.  
  18.     2. Altered source versions must be plainly marked as such, and must not be
  19.       misrepresented as being the original software.
  20.  
  21.     3. This notice may not be removed or altered from any source distribution.
  22.  
  23.     http://www.smalleranimals.com
  24.     smallest@smalleranimals.com
  25.  
  26. **********************************************************************/
  27.  
  28. #if !defined(AFX_PREFSDIALOG_H__1B15B002_9152_11D3_A10C_00500402F30B__INCLUDED_)
  29. #define AFX_PREFSDIALOG_H__1B15B002_9152_11D3_A10C_00500402F30B__INCLUDED_
  30.  
  31. #if _MSC_VER >= 1000
  32. #pragma once
  33. #endif // _MSC_VER >= 1000
  34. // PrefsDialog.h : header file
  35. //
  36.  
  37. #include "..\resource.h"
  38. #include "SAPrefsStatic.h"
  39. #include "SAPrefsSubDlg.h"
  40.  
  41. class pageStruct
  42. {
  43.     public:
  44.     CSAPrefsSubDlg *pDlg;
  45.     UINT id;
  46.     CSAPrefsSubDlg *pDlgParent;
  47.     CString csCaption;
  48. };
  49.  
  50. #define WM_CHANGE_PAGE (WM_APP + 100)
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CSAPrefsDialog dialog
  54.  
  55. class CSAPrefsDialog : public CDialog
  56. {
  57. // Construction
  58. public:
  59.     CSAPrefsDialog(UINT nIDTemplate = CSAPrefsDialog::IDD, CWnd* pParent = NULL);    // standard constructor
  60.     ~CSAPrefsDialog();
  61.  
  62. // Dialog Data
  63.     //{{AFX_DATA(CSAPrefsDialog)
  64.     enum { IDD = IDD_SAPREFS };
  65.     CStatic    m_boundingFrame;
  66.     //}}AFX_DATA
  67.  
  68.     // dialog title
  69.     void SetTitle(CString t)    {m_csTitle = t;}
  70.  
  71.     // used in the pretty shaded static control
  72.     void SetConstantText(CString t)    {m_csConstantText = t;}
  73.  
  74.     // add a page (page, page title, optional parent)
  75.     bool AddPage(CSAPrefsSubDlg &page, LPCTSTR pCaption, CSAPrefsSubDlg *pDlgParent = NULL);
  76.  
  77.     // show a page
  78.     bool ShowPage(int iPage);
  79.  
  80.     bool ShowPage(CSAPrefsSubDlg * pPage);
  81.  
  82.     // end the dialog with a special return code
  83.     void EndSpecial(UINT res, bool bOk = true);
  84.     
  85.     // set the first page
  86.     void SetStartPage(CSAPrefsSubDlg *pPage = NULL) {m_pStartPage = pPage;}
  87.  
  88.  
  89. // Overrides
  90.     // ClassWizard generated virtual function overrides
  91.     //{{AFX_VIRTUAL(CSAPrefsDialog)
  92.     public:
  93.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  94.     protected:
  95.     virtual void DoDataExchange(CDataExchange* pDX);     // DDX/DDV support
  96.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  97.     //}}AFX_VIRTUAL
  98.  
  99. // Implementation
  100. protected:
  101.     
  102.     bool EndOK();
  103.  
  104.     // if you don't like this, you can replace it with a static
  105.     CSAPrefsStatic        m_captionBar;
  106.     CTreeCtrl            m_pageTree;
  107.  
  108.     // check to see if this dlg has already been added to the tree
  109.     HTREEITEM FindHTREEItemForDlg(CSAPrefsSubDlg *pParent);
  110.  
  111.     // Generated message map functions
  112.     //{{AFX_MSG(CSAPrefsDialog)
  113.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  114.     virtual BOOL OnInitDialog();
  115.     virtual void OnOK();
  116.     virtual void OnCancel();
  117.     afx_msg void OnSelchangedPageTree(NMHDR* pNMHDR, LRESULT* pResult);
  118.     afx_msg void OnGetdispinfoPageTree(NMHDR* pNMHDR, LRESULT* pResult);
  119.     afx_msg void OnPhelp();
  120.     //}}AFX_MSG
  121.     afx_msg LONG_PTR OnChangePage(WPARAM, LPARAM);
  122.     DECLARE_MESSAGE_MAP()
  123.  
  124.     std::vector<pageStruct *> m_pages;
  125.     int            m_iCurPage;
  126.     CRect        m_frameRect;
  127.     CString        m_csTitle, m_csConstantText;
  128.  
  129.     CSAPrefsSubDlg    *m_pStartPage;
  130.  
  131.     // store info about *pDlgs that have been added to 
  132.     // the tree - used for quick lookup of parent nodes
  133.     // DWORDs are used because HTREEITEMs can't be... blame Microsoft
  134.     std::map<CSAPrefsSubDlg *, DWORD> m_dlgMap;
  135. };
  136.  
  137. //{{AFX_INSERT_LOCATION}}
  138. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  139.  
  140. #endif // !defined(AFX_PREFSDIALOG_H__1B15B002_9152_11D3_A10C_00500402F30B__INCLUDED_)
  141.